import React from 'react'
import styles from './index.module.less'

import URL_PNG_EMPTY from '@/static/common/empty.png'
import URL_PNG_NORESULT from '@/static/common/empty.png'

type EmptyType = 'empty' | 'noResult'

type Props = {
    type?: EmptyType
    description?: string
}

const ICON_MAP: Record<EmptyType, string> = {
    empty: URL_PNG_EMPTY,
    noResult: URL_PNG_NORESULT,
}

const Empty: React.FC<Props> = props => {
    const { type = 'empty', description = '暂无相关数据' } = props

    return (
        <div className={styles.empty}>
            <img src={ICON_MAP[type]} />

            <p>{description}</p>
        </div>
    )
}

export default Empty
